package ee.videorentalstore.users.types;

import ee.videorentalstore.bonustracker.CustomerAndItsBonusPoints;
import ee.videorentalstore.bonustracker.CustomerBonusPointsManager;
import ee.videorentalstore.users.User;

public class Customer extends User
{
	public Customer()
	{
		startTrackingCustomerBonusPoints();
	}

	@Override
	public String getUserTypeName() 
	{
		return "Customer";
	}
	
	@Override
	public String getUserName() 
	{
		return name;
	}
	
	@Override
	public void setUserName(String name) 
	{
		super.name = name;
	}
	
	
	private void startTrackingCustomerBonusPoints()
	{
		CustomerAndItsBonusPoints customerAndItsBonusPoints = new CustomerAndItsBonusPoints();
		customerAndItsBonusPoints.setCustomer(this);
		
		CustomerBonusPointsManager.getInstance().setFirstEntryToStartTrackingCustomerAndItsBonusPoints(
				customerAndItsBonusPoints);
	}
}
